home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: in1.uu.net!demos!pluscom!usenet
- From: sergeyp@albea.ugatu.ac.ru (Sergey Pavlov)
- Subject: Re: Please please help a newbie!
- X-Newsreader: Forte Free Agent 1.0.82
- Sender: usenet@news.rinet.ru (Superuser)
- Nntp-Posting-Host: albea.ugatu.ac.ru
- Organization: Albea
- Message-ID: <DMt4qG.DLu@news.rinet.ru>
- References: <4ftoe8$5a2@pacifica.access.ch>
- Date: Thu, 15 Feb 1996 07:58:37 GMT
-
- tombeck@usemail.com (Thomas Beck) wrote:
-
- >Hi there!
-
- >It's quite embarrassing to ask those two questions, because they seem
- >absolutely stupid (they probably are). Yesterday I started to learn C/C++. I
- >bought a 700 pages book with a cd included that has two compilers on it). I
- >fully understand the chapter about the types, but the things I program just
- >can't be compiled. I extracted the following two problems:
-
- >----------- example 1: -------------
- >int i;
- >int & a=i;
-
- >main() {
- >}
- >--------------------------------------------
-
- >This is not compiled, I get the following output with Symantec C++ 6.11:
-
- >D:\SC>sc test1.c
-
- >sccx test1.c
- >int & a=i;
- > ^
- >test1.c(2) : Error: '=', ';' or ',' expected
-
- >--- errorlevel 1
-
- >The second thing that doesn't work is this:
-
- >----------- example 2: -------------
- >struct abc {
- > int i;
- > char a;
- > void f1() {
- > };
- >};
-
- >main() {
- >}
- >---------------------------------------------
-
- >This isn't compiled either, here's the output:
-
- >D:\SC>sc test2.c
-
- >sccx test2.c
- > void f1() {
- > ^
- >test2.c(4) : Error: illegal type for 'f1' member
-
- >--- errorlevel 1
-
-
- >Before you think I'm absolutely stupid... I used to be very good at Pascal
- >(TP 6.0), and I'm also experienced in OOP under Pascal. I have no clue of
- >C++, however, and I can only rely on what's written in that book. Apparently
- >it doesn't tell me the truth, does it?
-
- >Can you please help me with those two problems (referenced variable and
- >function within a class), so that I can go on and learn a few more difficult
- >things?
-
- >Thanks in advance,
-
- >Thomas Beck, tombeck@usemail.com
-
- >=================================================================
- >Summer's day, as she passed away. Birds were singing in the
- >summer sky; then came the rain, and once again, a tear fell
- >from her mother's eye...
- >=================================================================
-
- Probably, you use C (not C++) compiler.
-
-